Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Move Host DB to SQL Impl #1804

Merged
merged 126 commits into from
Apr 11, 2024
Merged

WIP Move Host DB to SQL Impl #1804

merged 126 commits into from
Apr 11, 2024

Conversation

badgersrus
Copy link
Contributor

@badgersrus badgersrus commented Feb 20, 2024

Why this change is needed

Tenscan Improvements

What changes were made as part of this PR

  • Delete all the old host KV storage code
  • Add sqlite and postgres DB implementation for host database
  • Switched host nodes in the simulation package to be in-memory as we don't want to handle spin up/ tear down of a database each time we run a PR build
  • Deployed dev/ uat postgres DB which is passed through github action config

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

badgersrus and others added 30 commits February 9, 2024 16:43
Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the pain, Will.
The general pattern for transactions is:

tx:=startTransaction()
err:=doStuff1(tx)
if err!=nil{
  tx.Rollback()
}
err:=doStuff2(tx)
if err!=nil{
  tx.Rollback()
}
..
err:=doStuffN(tx)
if err!=nil{
  tx.Rollback()
}

tx.Commit()

The code needs a bit more reshuffling in that area

go/host/storage/storage.go Outdated Show resolved Hide resolved
@badgersrus badgersrus requested a review from tudor-malene April 10, 2024 16:18
Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Will. I think functionally it looks good now.
I left a few comments around minor cosmetic issues. Then, it should be good to merge

integration/simulation/simulation.go Outdated Show resolved Hide resolved
integration/simulation/devnetwork/node.go Outdated Show resolved Hide resolved
integration/simulation/validate_chain.go Show resolved Hide resolved
integration/tenscan/tenscan_test.go Outdated Show resolved Hide resolved
go/node/docker_node.go Outdated Show resolved Hide resolved
@@ -196,7 +189,7 @@ func (h *host) Stop() error {
}
}

if err := h.db.Stop(); err != nil {
if err := h.storage.Close(); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BedrockSquirrel , I'm wondering why we didn't register the database as a service the first time

@badgersrus badgersrus requested a review from tudor-malene April 11, 2024 09:30
Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Nice work!

@badgersrus badgersrus merged commit 860b34d into main Apr 11, 2024
2 checks passed
@badgersrus badgersrus deleted the will/sql-host-impl branch April 11, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants